#加码
str_text = "这是一段文本"

#将字符串内容加码，变成二进制数据类型
temp = str_text.encode("utf-8")
print(temp, type(temp))             #<class 'bytes'>，二进制数据

print(temp.decode("utf-8"))